﻿using FluentNHibernate.Mapping;
using Messenia.Data.Models;

namespace Messenia.Data.Hibernate.Map {
  public
    class ProjectMap: ClassMap<Project> {
    public ProjectMap() {
            Table("Projects");
            
            Id(x => x.Project_ID,"Project_ID");
            Map(x => x.Name );        
            Map(x => x.Description );
            Map(x => x.CreationDate );
            References(x => x.ProjectStatus ).LazyLoad(Laziness.False);
            Map(x => x.DeadLineDate);
            References(x => x.Creator ).LazyLoad(Laziness.False);
            References(x => x.Responsabile).LazyLoad(Laziness.False);
            Map(x => x.Priority);
            Map(x => x.GroupingGUID, "Project_GroupingGUID");
            Map(x => x.Rating);
            //HasManyToMany(x => x.Groups)
            //.Cascade.All()
            //.Table("ProjectGroup");
        }
    }
}
